function EFFECT:Init( data )
	self.entAttach = data:GetEntity()
	
	if !IsValid(self.entAttach) then return end

	self.ColorScale = data:GetScale()

	self.Color = self.ColorScale*255

	local diff = self.entAttach:OBBMaxs() - self.entAttach:OBBMins()

	self.OffsetY = math.Rand(-48, 32)
	self.OffsetX = math.Rand(-16, 16)

	print(self.OffsetY, self.OffsetX)

	self.Pos = self.entAttach:LocalToWorld(self.entAttach:OBBCenter()) + self.entAttach:GetRight() * self.OffsetY + self.entAttach:GetForward() * self.OffsetX
	
	self:GetEmitter(self.Pos)

	self.EmitTime = 0
end

function EFFECT:Emit()
	if CurTime() < self.EmitTime + 0.15 then return end
	self.EmitTime = CurTime()

	self.Pos = self.entAttach:LocalToWorld(self.entAttach:OBBCenter()) + self.entAttach:GetRight() * self.OffsetY + self.entAttach:GetForward() * self.OffsetX
	
	self:GetEmitter(self.Pos)

	local grav = Vector(0, 0, math.random(60, 70))

	for i=0, 1 do
		local particle = self.Emitter:Add( "particles/smokey", self.Pos )
		if (particle) then

			particle:SetLifeTime( 0 )
			particle:SetDieTime( 2 )
		
			particle:SetStartAlpha( 190 )
			particle:SetEndAlpha( 0 )

			particle:SetStartSize( 24 )
			particle:SetEndSize( 24 )

			particle:SetCollide( false )

			particle:SetColor(self.Color, self.Color, self.Color)

			particle:SetRollDelta( math.Rand(-4, 4) )
			particle:SetVelocity(VectorRand() * 10 + Vector(0,0,100))
			particle:SetGravity( grav )
		end
	end
end

function EFFECT:Think()
	if !IsValid(self.entAttach) then self:GetEmitter():Finish() return false end

	self:Emit()
	return true
end

function EFFECT:GetEmitter( Pos )

	if self.Emitter then
		if self.EmitterTime > CurTime() then
			self.Emitter:SetPos(Pos or Vector(0,0,0))
			return self.Emitter
		end
		self.Emitter:Finish()
	end
	
	self.Emitter = ParticleEmitter( Pos or Vector(0,0,0) )
	self.EmitterTime = CurTime() + 0.5

	return self.Emitter
end

function EFFECT:Render()
end

